<?php
// +----------------------------------------------------------------------
// | 海豚PHP框架 [ DolphinPHP ]
// +----------------------------------------------------------------------
// | 版权所有 2016~2017 河源市卓锐科技有限公司 [ http://www.zrthink.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://dolphinphp.com
// +----------------------------------------------------------------------
// | 开源协议 ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------

namespace app\member\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\admin\validate
 * @author 蔡伟明 <314013107@qq.com>
 */
class Balance extends Validate
{
    //定义验证规则
    protected $rule = [
        'invoice_type|发票类型' => 'require',
        'company|单位名称' => 'require',
        'taxpayer_no|纳税人识别号' => 'require',
        'tel|手机号'   => 'require|regex:^1[0-9]{10}$',
        'accountname|银行开户名' => 'require',
        'bankno|公司银行账户'   => 'require',
        'bankname|开户银行支行名称'     => 'require',
        'bankid|支行联行号'  => 'require',
        'bandaddr|开户银行所在地'   => 'require',
        'signup_address|注册地址'   => 'require',
    ];

    //定义验证提示
    protected $message = [
        'invoice_type.require' => '请选择发票类型',
        'company.require' => '请输入单位名称',
        'taxpayer_no.require' => '请输入纳税人识别号',
        'tel.regex'     => '联系电话不正确',
        'tel.require'     => '联系电话不能为空',
        'tel.unique'     => '联系电话已存在',
        'accountname.require' => '请输入银行开户名',
        'bankno.require'     => '请输入公司银行账户',
        'bankname.require'    => '请输入开户银行支行名称',
        'bankid.require' => '请输入支行联行号',
        'bandaddr.require'     => '请输入开户银行所在地',
        'signup_address.require'     => '请输入注册地址',
    ];
    protected $scene = [
        //更新
        'update'  =>  ['invoice_type', 'company', 'taxpayer_no', 'tel','accountname', 'bankno','bankname','bankid','bandaddr','addr'],
    ];
}
